#include <stdio.h>

int main(){
    int arr[] = {8,4,1,3,2,7,5,9,6};
    int n = sizeof(arr)/sizeof(arr[0]);
    for(int i=1;i<n;i++){
        int j=i;
        int temp;
        while (j>0)
        {
            if (arr[j]<arr[j-1]){
                temp = arr[j];
                arr[j] = arr[j-1];
                arr[j-1] = temp;
                j--;
            }else{break;}
        }
        
    }
    for (int i=0;i<n;i++){
        printf("%d ",arr[i]);
    }

    return 0;
}